package org.softwarer.client.controller;

import org.softwarer.client.domain.Dog;
import org.softwarer.client.dto.DemoParam;
import org.softwarer.framework.web.ResultResponse;
import org.springframework.web.bind.annotation.*;

/**
 * {@code @Author} 郝学胜
 * {@code @Date} 2025/9/25 12:43
 * {@code @Description}
 */
@RestController
public class DemoController {

    @GetMapping("/say")
    public ResultResponse<Boolean> say(DemoParam param){
        System.out.println(param);
        return ResultResponse.message("Hello Demo !!!");
    }

    @PostMapping("/look")
    public ResultResponse<Boolean> look(@RequestBody Dog dog){
        String message = String.format("Post %s是一条%d岁的老狗！", dog.getName(), dog.getAge());
        System.out.println(message);
        return ResultResponse.message(message);
    }

    @PutMapping("/see")
    public ResultResponse<Boolean> see(@RequestBody Dog dog){
        String message = String.format("Put %s是一条%d岁的老狗！", dog.getName(), dog.getAge());
        System.out.println(message);
        return ResultResponse.message(message);
    }
}
